<!DOCTYPE html>
<html>
<head>
  <title>交易页面</title>
  <meta charset='utf-8'>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Bootstrap CSS -->
  <link href="css/bootstrap.css" rel="stylesheet" media="screen">

  <!-- date range -->
  <link rel="stylesheet" type="text/css" href="css/daterange.css">

  <!-- Main CSS -->
  <link href="css/main.css" rel="stylesheet" media="screen">

  <!--custom CSS-->
  <link href="css/custom.css" rel="stylesheet" media="screen">
  <!-- Font Awesome CSS -->
  <link href="../fonts/font-awesome.css" rel="stylesheet">

  <!--[if IE 7]>
  <link rel="stylesheet" href="../fonts/font-awesome.css">
  <![endif]-->

  <!-- HTML5 shiv and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/libs/html5shiv.js"></script>
  <script src="js/libs/respond.min.js"></script>
  <![endif]-->

</head>


<body>
<script type="text/x-handlebars">
  <div class="container">
    <div class="top-bar">

      <div class="logo">
        Trader<sup><i class="icon-glass"></i></sup>
      </div>

      <!-- Icon nav start -->
      <ul id="icon-nav">
        <li>
          <a href="#">
            <i class="icon-bell"></i>
            <span class="count-label"></span>
          </a>
        </li>
        <li>
          <a href="#">
            <i class="icon-comment-alt"></i>
            <span class="count-label count-lb-yellow"></span>
          </a>
        </li>
        <li>
          <a href="#">
            <i class="icon-envelope-alt"></i>
            <span class="count-label count-lb-green"></span>
          </a>
        </li>
      </ul>
      <!-- Icon nav end -->


    </div>

    <header class="navbar" role="navigation">
      <div class="navbar-header">
        <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a href="#" class="navbar-brand">&nbsp;</a>
      </div>
      <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">

        
          <ul class="nav navbar-nav">
            <li>
              {{#link-to 'trader'}}交易{{/link-to}}
            </li>

            <li>
              {{#link-to 'history'}}历史{{/link-to}}
            </li>
          </ul>
        

        <!-- Mini navigation start -->
        <ul class="nav navbar-nav navbar-right hidden-sm hidden-xs">
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user"></i> yu wang <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#">修改资料</a></li>
              <li><a href="calendar.html">修改密码</a></li>
              <li class="divider"></li>
              <li><a href="login.html">退出</a></li>
            </ul>
          </li>
        </ul>
        <!-- Mini navigation end -->
      </nav>
    </header>
    <!-- Header end -->


    <div class="page-title">

      <div class="row">

        <div class="col-md-2 col-sm-2" id="avatar_box">
          <a href="javascript:void(0)" class="avatar-frame fleft"
              ><img src="../img/avatar-2.png" style="border-width:0px;">
          </a>

        </div>
        <div class="col-md-2 col-sm-2" id="user-details">
          <h3><a href="javascript:void(0)" class="user-name">yu  wang</a></h3>
          <div class="">
            <p><strong>总盈利: </strong> + $2183</p>
            <p><strong>投资回报率: </strong> + 98%</p>
          </div>
        </div>
        <div class="col-md-8 col-sm-8">
          <div class="" id="dashboard_status">
            <div class="row">
              <div class="col-md-3 col-sm-3">
                <p><span class="label label-info">账户净值</span></p>
                <p><h3><b>$4080.72</b></h3></p>
              </div>
              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">保证金</span></p>
                <p class="normal_number">$3080.72</p>
              </div>
              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">可用预付款</span></p>
                <p class="normal_number">$1080.72</p>
              </div>
              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">保证金比例</span></p>
                <p class="normal_number">83%</p>
              </div>
              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">初始资金</span></p>
                <p class="normal_number">$3450.21</p>
                </div>
            </div>
            <div class="row">
              <div class="col-md-3 col-sm-3">
                <p><span class="label label-info">交易次数</span></p>
                <p class="normal_number">93</p>
              </div>

              <div class="col-md-2 col-sm-3">
                <p><span class="label label-info">交易手数</span></p>
                <p class="normal_number">9.5手</p>
              </div>

              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">交易时长</span></p>
                <p class="normal_number">135天</p>
              </div>
              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">当前持有头寸</span></p>
                <p class="normal_number">7</p>
              </div>

              <div class="col-md-2 col-sm-2">
                <p><span class="label label-info">当前持有手数</span></p>
                <p class="normal_number">1.8手</p>
              </div>
            </div>
          </div>
        </div>
      </div>

    </div>
    <!-- Page title end -->

    {{ outlet }}
</script>


<script type="text/x-handlebars" id="trader">
  <div class="pager">

    <div class="row">
      <div class="col-md-2 col-md-offset-10 col-sm-2 col-sm-offset-10 fix-report-botton">
        <a class="btn btn-info btn-lg" href="javascript:void(0)">
          <i class="icon-bar-chart"></i> 观看报价
        </a>
      </div>
    </div>

    <!--这下面装的都是货币对-->
    <div class="row">

      {{#each}}
      <div class="col-md-3 col-sm-3 col-sx-3">
        <div class="panel panel-default">
          <div class="panel-heading clearfix">
            <i class="icon-tag"></i>
            <h3 class="panel-title">{{name}}</h3>
          </div>
          <div class="panel-body">
            <div class="row">
              <div class="col-md-6 col-sm-6 col-sx-6">
                <a href="javascript:void(0)"><h2><span class="label label-success">{{sell_price}}</span></h2></a>
              </div>

              <div class="col-md-6 col-sm-6 col-sx-6">
                <a href="javascript:void(0)"><h2><span class="label label-danger">{{buy_price}}</span></h2></a>
              </div>
            </div>
            <div class="row">
              <div class="col-md-5 col-sm-5 col-sx-5">
                卖出
              </div>
              <div class="col-md-2 col-sm-2 col-sx-2">
                {{CalculateSpread buy_price sell_price pip}}
              </div>
              <div class="col-md-5 col-sm-5 col-sx-5">
                买入
              </div>
            </div>

          </div>
        </div>
      </div>
      {{/each}}

      </div>
      </div>
</script>


<script type="text/x-handlebars" id="history">
<div class="row">
  <div class="col-md-12 col-sm-12">
    <div class="row my-todo">图表等着做完统一上highcharts</div>
    <div class="panel panel-default">
      <div class="panel-heading clearfix">
        <i class="icon-bar-chart"></i>

        <h3 class="panel-title">历史记录</h3>
      </div>
      <div class="panel-body">

        <div class="table-responsive">
          <table id="money-table" class="table table-bordered table-hover no-margin">
            <thead>
            <tr>
              <th style="width:10%">货币对</th>
              <th style="width:10%">类型</th>
              <th style="width:10%">手数</th>
              <th style="width:10%">开仓时间</th>
              <th style="width:10%">平仓日期</th>
              <th style="width:10%">开仓价位</th>
              <th style="width:10%">最高</th>
              <th style="width:10%">最低</th>
              <th style="width:10%">获利</th>
              <th style="width:10%">总和</th>

            </tr>
            </thead>
            <tbody>
            {{#each itemController="lot_item"}}
              <tr {{bind-attr class="isWin:success:danger"}}>
                <td>
                  <span>{{name}}</span>
                </td>
                <td><span>{{type}}</span></td>
                <td>{{lots}}</td>
                <td>{{opened_at}}</td>
                <td>{{closed_at}}</td>
                <td>
                  <p>{{opened_price}}</p>

                  <p>{{closed_price}}</p>
                </td>
                <td>{{highest_pips}}</td>
                <td>{{lowest_pips}}</td>
                <td>
                  <p>{{earn_pips}}点</p>

                  <p>
                <span class="label label-success">
                  ${{earn_dollar}}
                </span>
                  </p>
                </td>
                <td>
                  <p>{{totol_pips}}点</p>

                  <p>${{total_dollar}}</p>

                </td>

              </tr>

            {{/each}}

            </tbody>
          </table>
        </div>
        <div class="row">
          <div class="col-md-8 col-sm-8 pagination_detail">
            <b>显示{{length}}个交易中的1-{{length}}单</b>
          </div>
          <div class="col-md-4 col-sm-4 pagination_box">
            <ul class="pagination no-margin">
              <li class="disabled"><a href="#" data-original-title="" title="">«</a></li>
              <li class="active"><a href="#" data-original-title="" title="">1</a></li>
              <li><a href="#" data-original-title="" title="">2</a></li>
              <li><a href="#" data-original-title="" title="">3</a></li>
              <li><a href="#" data-original-title="" title="">4</a></li>
              <li><a href="#" data-original-title="" title="">5</a></li>
              <li><a href="#" data-original-title="" title="">6</a></li>
              <li><a href="#" data-original-title="" title="">»</a></li>
            </ul>
          </div>
        </div>
      </div>

    </div>

  </div>
</div>
</div>
</script>


<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/libs/jquery.js"></script>

<script src="js/libs/handlebars.js"></script>

<script src="js/libs/ember.js"></script>

<script src="js/libs/showdown.min.js"></script>

<script src="js/libs/moment-with-langs.js"></script>

<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/libs/bootstrap.min.js"></script>

<!-- Sparkline graphs -->
<script src="js/libs/sparkline.js"></script>

<!-- Tyny Scrollbar -->
<script src="js/libs/tiny-scrollbar.js"></script>

<!-- Date Range -->
<script src="js/libs/daterange/moment.js"></script>
<script src="js/libs/daterange/daterangepicker.js"></script>

<!-- Custom JS -->
<script src="js/libs/custom.js"></script>
<script src="js/libs/custom-index.js"></script>
<script src="js/app.js"></script>
</body>
</html>